<style scoped>
  .addlist .activ{
    transform: rotate(180deg);
  }
  .addlist{
   width: 100%;
   border-top: 1px solid #242C40;
  }
  .addlist p{
    height: 36px;
    line-height: 36px;
    margin: -1px auto 0;
    border-top: 1px solid #1E72AE;
    width: 154px;
    color: #1E72AE;
    cursor: pointer;
  }
  .addlist p img{
    margin-left: 5px;
  }
  .list-box{
    padding: 15px 0px 5px;
  }
  .list-box ul{
    display: flex;
    flex-wrap: wrap;
    width: 1140px;
    margin:  0 auto;
    height: 150px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all .15s;
  }
  .list-box ul li{
    width: 135px;
    margin-right: 10px;
    margin-bottom: 20px;
    cursor: pointer;
  }
  .list-box ul::-webkit-scrollbar{
    width: 0;
  }
  .list-box ul li:nth-child(8n){
    margin-right: 0;
  }
  .list-box-anmite{
    background-image:url(../../assets/fight-list-bg.png);
    background-repeat: no-repeat;
    position: absolute;
    top: -15px;
    left: -15px;
    bottom: -15px;
    right: -15px;
    z-index: 1;
    background-size: 100% 100%;
  }
  .list-box ul li:hover .list-box-anmite{
     background-image:url(../../assets/fight-list-bgac.png);
     transform: rotate(90deg);
     transition:all .5s ease-out;
  }
  .list-box ul li:hover .list-box-item{
   /* background-position: 5px 5px;
     margin-top: -40px; */
   /* top: 40%;
    left: 50%;
    transition: 0.5s;
    transform: translate(-50%, 0%) rotate(-5deg); */
  }
  .list-box-item{
    position: absolute;
    z-index: 9;
    max-width: 100px;
    max-height: 100px;
    width: auto ;
    height: auto;
    top: 50%;
    left: 50%;
    transition:all 0.5s;
    transform: translate(-50%, -50%);
  }
  .list-box-item img{
    position: absolute;
    max-width: 100px;
    max-height: 100px;
    width: auto ;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .list-box-box{
    position: absolute;
    width: 90px;
    height: 90px;
    top: 50%;
    margin-top: -45px;
    left: 50%;
    margin-left: -45px;
    z-index: 6;
  }
  .list-box-box img{
    position: absolute;
    max-width: 90px;
    max-height: 90px;
    width: auto ;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .list-box ul{
    display: flex;
    /* justify-content: space-between; */
    flex-wrap: wrap;
    min-height: 225px;
  }

  .list-box ul li:nth-child(4n){
    margin-right: 0px;
  }
  .list-box ul li>div:first-child{
    width: 135px;
    height: 135px;
    position: relative;
    margin:  0 auto 8px;
  }

  .hbb-list ul li>div:last-child{
    margin:0 auto;
    width:110px ;
  }
  .list-box ul li>div:last-child>div:first-child{
    width: 97px;
    height: 27px;
    background-image: url(../../assets/hbb-btn-bgs.png);
    background-size: 100% 100%;
    margin:  0 auto;
    line-height: 27px;
    color: #FFFFFF;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }
  .list-box ul li:hover>div:last-child>div:first-child{
    background-image: url(../../assets/hbb-btn-bg.png);
  }
  .list-box ul li>div:last-child>div:last-child{
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px auto;
    font-size: 12px;
    color: #FFA32A;
  }
  .list-box ul li>div:last-child>div:last-child img{
    width: 12px;
    height: 12px;
  }
  .list-box ul li>div:last-child>div:last-child p{
    margin-left: 5px;
  }
  .popup{
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    background: rgba(0, 0, 0, .5);
    z-index: 999;
    transition: all .5;
  }
  .content{
    width: 1200px;
    background: #2B3242;
    margin: 83px auto 10px;
    padding-bottom: 10px;
    transform: scale(0);
    transition: all .5s;
  }
  .showcontent{
    transform: scale(1);
  }
  .title{
    height: 54px;
    padding: 0 22px;
    font-size: 22px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .close{
    font-size: 40px;
    cursor: pointer;
  }
  .list-box{
    background: #191E2B;
    display: flex;
    flex-flow: wrap;
    padding-top: 16px;
  }
  .data-item{
    width: 20%;
    padding: 0 16px 24px;
    font-size: 14px;
    text-align: left;
    color: #fff;
    padding-left: 15px;
    box-sizing: border-box;
  }
  .data-bg{
    height: 151px;
    background: url(../../assets/color03.png);
    background-size: 100% 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
  .gong{
    width: 95%;
  }
  .money{
    margin: 9px 0 5px 0;
    display: flex;
    align-items: center;
    color: #FFA32A
  }
  .money-ico{
    width: 15px;
    margin-right: 5px;
  }
</style>

<template>
  <div class="list-box">
    <ul :style="{ height: activ == 0 ? '150px' : '400px' }">
      <li v-for="(fight, index) in fightBoxList" :key="fight.id" @click="showDetail(index)">
        <div>
          <div class="list-box-anmite"></div>
          <div class="list-box-box"><img :src="fight.backgroundImage" ></div>
          <div class="list-box-item"><img :src="fight.boxSkinList[0].skinDetails.image" ></div>
        </div>
        <div>
          <div>{{fight.name}}</div>
          <div><div><img src="../../assets/money-icon.png" ></div><p>{{fight.boxSkinList[0].skinDetails.price}}</p></div>
        </div>
      </li>
    </ul>
    <div class="addlist">
      <p  @click="addlist(1)" v-if="activ==0">展开<img src="../../assets/direction-icon1.png" ></p>
      <p  @click="addlist(0)" v-else>收起<img class="activ" src="../../assets/direction-icon1.png" ></p>
    </div>
    <div class="popup" :style="{ width: modalWidth }">
      <div :class="['content', { showcontent: detailModal }]">
        <div class="title" v-if="fightBoxList[currentIndex]">
          <p>{{fightBoxList[currentIndex].name}}</p>
          <p class="close" @click="detailModal = false">×</p>
        </div>
        <div class="list-box" v-if="fightBoxList[currentIndex]">
          <div v-for="(skin, index) in fightBoxList[currentIndex].boxSkinList" :key="index" class="data-item">
            <div class="data-bg" :style='{ backgroundImage: `url(${levalMap[skin.skinDetails.rarity]})` }'>
              <img class="gong" :src="skin.skinDetails.image" alt="">
            </div>
            <p class="money"><img class="money-ico" src="../../assets/money-icon.png" alt=""> {{skin.skinDetails.price}}</p>
            <p>{{skin.skinDetails.skinName}}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
<script>
import pagination from '../pagination.vue'
export default {
  props: {
    fightBoxList: {
      type: Array,
      default: []
    }
  },
  components: {
    'v-pagination': pagination
  },
 data () {
    return {
      modalWidth: 0,
      levalMap: {
        '工业级': require('../../assets/color01.png'),
        '消费级': require('../../assets/color01.png'),
        '普通级': require('../../assets/color01.png'),
        '军规级': require('../../assets/color01.png'),
        '高级': require('../../assets/color01.png'),
        '保密': require('../../assets/color01.png'),
        '受限': require('../../assets/color02.png'),
        '非凡': require('../../assets/color03.png'),
        '隐秘': require('../../assets/color04.png'),
        '违禁': require('../../assets/color05.png'),
      },
      currentIndex: 0,
      detailModal: false,
      activ: 0
    }
  },
  watch: {
    detailModal(newVal) {
      if (newVal) {
        this.modalWidth = '100vw'
      } else {
        setTimeout(() => {this.modalWidth = 0}, 500)
      }
    }
  },
  methods: {
    addlist(e){
      this.activ=e
    },
    showDetail(index) {
      this.detailModal = true
      this.currentIndex = index
    }
  }
}
</script>